package com.open.demo.设计模式

/**
 *
 * @Author: hailong.qiu hailong.qiu@xgimi.com
 * @Maintainer: hailong.qiu hailong.qiu@xgimi.com
 * @Date: 2021/12/30
 * @Copyright: 2021 www.xgimi.com Inc. All rights reserved.
 */
class 委托 {
}

interface Subject {
    fun buy()
}

class Delegate : Subject {

    override fun buy() {
        println("Delegate#buy")
    }
}

class RealSubject : Subject by Delegate() {
}

val delegate = Delegate()
//var message:String get() = delegate.toString()
//set(value) = delegate = value